Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROF-10128] Fix profiling benchmarking configuration still having auto_instrument overhead #3818

Merged

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Jul 31, 2024

What does this PR do?

This PR tweaks the ADD_TO_GEMFILE environment variable for benchmarking configurations where only the profiler should be active to not include require: 'datadog/auto_instrument'.

It turns out this change was added in #3614 when we fixed the benchmarks not running. Loading the instrumentation code and then disabling tracing has a measurable performance overhead vs not loading it at all (20% regression of median throughput in high load gitlab tests).

Motivation:

I expect that with this change, the only-profiling configuration will reflect historical data we had before the change in #3614.

This is relevant because we use this data as basis for comparison with other profiling features (e.g. allocation) and thus it's important to have a correct baseline.

Additional Notes:

I noticed a similar-ish configuration issue in our reliability environment. I'll open a separate PR for that one as well.

How to test the change?

I've tested a similar configuration using bp-runner locally and confirmed that overhead is reduced. Once we merge this in, I'll validate that the nightly runs show performance is back to where it was on the 18th of April.

…to_instrument overhead

**What does this PR do?**

This PR tweaks the `ADD_TO_GEMFILE` environment variable for
benchmarking configurations where only the profiler should be active to
not include `require: 'datadog/auto_instrument'`.

It turns out this change was added in #3614 when we fixed the benchmarks
not running. Loading the instrumentation code and then disabling tracing
has a measurable performance overhead vs not loading it at all (20%
regression of median throughput in high load gitlab tests).

**Motivation:**

I expect that with this change, the `only-profiling` configuration will
reflect historical data we had before the change in #3614.

This is relevant because we use this data as basis for comparison with
other profiling features (e.g. allocation) and thus it's important to
have a correct baseline.

**Additional Notes:**

I noticed a similar-ish configuration issue in our reliability
environment. I'll open a separate PR for that one as well.

**How to test the change?**

I've tested a similar configuration using `bp-runner` locally and
confirmed that overhead is reduced. Once we merge this in, I'll validate
that the nightly runs show performance is back to where it was on the
18th of April.
@ivoanjo ivoanjo requested a review from a team as a code owner July 31, 2024 14:48
@ivoanjo
Copy link
Member Author

ivoanjo commented Jul 31, 2024

Here's a screenshot showing how tracing was still getting loaded even in the only-profiling configuration:

image

@ivoanjo
Copy link
Member Author

ivoanjo commented Jul 31, 2024

And here's how my run with bp-runner looks showing there's no stack traces from the datadog gem instrumenting rack:

image

@pr-commenter
Copy link

pr-commenter bot commented Jul 31, 2024

Benchmarks

Benchmark execution time: 2024-07-31 15:18:01

Comparing candidate commit a795558 in PR branch ivoanjo/prof-10128-fix-profiling-benchmarking-configuration with baseline commit 47f12db in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics.

@ivoanjo ivoanjo enabled auto-merge July 31, 2024 16:01
@ivoanjo ivoanjo merged commit 6975467 into master Jul 31, 2024
180 of 181 checks passed
@ivoanjo ivoanjo deleted the ivoanjo/prof-10128-fix-profiling-benchmarking-configuration branch July 31, 2024 16:15
@github-actions github-actions bot added this to the 2.3.0 milestone Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants